package com.powerrich.dubbo.service;

import com.alibaba.dubbo.config.annotation.Reference;
import com.powerrich.dubbo.pojo.CityPo;
import com.powerrich.dubbo.pojo.UserPo;
import org.springframework.stereotype.Component;

/**
 * @author 黄雨
 * @title: CityDubboConsumerService
 * @projectName demo
 * @description: TODO
 * @date 2019-04-108:49
 */
@Component
public class CityDubboConsumerService {

    @Reference
    CityDubboService cityDubboService;

    @Reference
    UserService userService;

    public void printCity() {
        String cityName = "广州";
        CityPo city = cityDubboService.findCityByName(cityName);
        System.out.println(city.toString());
    }

    public UserPo saveUser() {
        UserPo user = new UserPo();
        user.setId(1);
        user.setName("jaycekon");
        user.setAge(12);
        user.setSex("男");
        return userService.saveUser(user);
    }
}
